Efficient mirroring of directories using hard links [closed]

Posted by zoqaeski on Server Fault See other posts from Server Fault or by zoqaeski
Published on 2012-07-07T08:01:09Z Indexed on 2012/07/07 9:18 UTC
Read the original article Hit count: 143

Filed under:
|
|
|

I'm backing up my music collection on to a number of NTFS-formatted external hard-drives; however, as I store my main collection in FLAC and have my library on my laptop as MP3s to save space, I want to be able to back up both sets, because mass conversion between formats is time-consuming.

The "music" directory can contain any format; the "mp3s" directory contains only MP3s converted from files in the "music" directory. The music collection on the laptop contains only MP3s, but they come from both sources. When I backup my laptop's library to the "mp3s" directory, I want to only copy across MP3 files that don't exist in the "music" directory; those that do should be hard-linked to the "music" directory.

All directories have an identical hierarchy, sorted by artist, album, date, discnumber if applicable, etc, and I use a tagging editor to ensure consistency across all these locations. I'm also using a Linux computer, but keeping the music collections on NTFS-formatted partitions so that they are readable by both Linux and Windows.

At the moment, I use the following command to perform the backups, but this is time-consuming due to the expensive nature of finding hard links.

rsync -avu --progress --relative --ignore-existing --link-dest=../music/ **/*.mp3 /media/ntfspocket/mp3s

Is there a way to perform this backup more efficiently, taking advantage of the directory hierarchy?

© Server Fault or respective owner

Related posts about linux

Related posts about rsync